<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        arr01=[31,12,45,33,24,16,54,27,19,25,7,65];
        pivot=arr01[0];
        small=[];
        big=[];
        //for of对数组中的值进行循环，el为：31,12...等
        for(i=1;i<arr01.length;i++){
            if(arr01[i]<=pivot){
                small.push(arr01[i]);
            }else{
                big.push(arr01[i]);
            }
        }
       // console.log(arr01);
        console.log(small,pivot,big);
    </script>
    
</body>
</html>